<?php

include('../../lib/domParserClass.php');
include('config.php');
$articles = array();
$html = file_get_html(_URL_CIBLE_ . _AUTOMOTO_);


foreach ($html->find('table.listing_results') as $article) {
    
       //Ajouter base url du site cible dans les hrefs des annonces pour une rediréction simple
       $article->find('a', 0)->setAttribute('href',_URL_CIBLE_.$article->find('a', 0)->getAttribute('href'));
       $article->find('a', 1)->setAttribute('href',_URL_CIBLE_.$article->find('a', 1)->getAttribute('href'));
       $article->find('a', 2)->setAttribute('href',_URL_CIBLE_.$article->find('a', 2)->getAttribute('href'));
       
       $reponse = $article->find('table.listing_table', 0)->outertext;
    
       echo $reponse;
       die;
}


?>
